/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sajus.web.billing.ejb.data.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author thomas li
 */
@Entity
@Table(name = "servicetype")
@NamedQueries({
    @NamedQuery(name = "ServiceType.findAll", query = "SELECT c FROM ServiceType c") ,
    @NamedQuery(name = "ServiceType.findCurrentIndex", query = "SELECT r FROM ServiceType r WHERE r.id= ( SELECT max(d.id) FROM ServiceType d )" )
    })
public class ServiceType extends PersistentObject {
    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;
    
    @Column(name = "description")
    private String description;
    
    @Column(name = "type")
    private Integer type;
    
    @Column(name = "unit")
	private String unit;
    
    @Column(name = "servicecolumn")
	private String servicecolumn;
    
    @Column(name = "servicetable")
	private String servicetable;
    
    @Column( name = "service_id" )
    private String identifier;
    
    @Column( name = "channel_id")
    private String channelId;

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServiceType)) {
            return false;
        }
        ServiceType other = (ServiceType) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals( other.id) ) ) {
            return false;
        }
        return true;
    }

    @Override
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public String getServicecolumn() {
		return servicecolumn;
	}

	public void setServicecolumn(String servicecolumn) {
		this.servicecolumn = servicecolumn;
	}

	public String getServicetable() {
		return servicetable;
	}

	public void setServicetable(String servicetable) {
		this.servicetable = servicetable;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public String getChannelId() {
		return channelId;
	}

	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}

    
}
